package com.syx.service.impl;

import com.syx.dao.LogDao;
import com.syx.entity.Detail;
import com.syx.entity.Logs;
import com.syx.entity.User;
import com.syx.service.LogService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class LogServiceImpl implements LogService {
    @Resource
    private LogDao dao;

    @Override
    public List list(Map map) {
        return dao.list(map);
    }

    @Override
    public User login(User user) {
        return dao.login(user);
    }

    @Override
    public int getSnowId(String oid) {
        return dao.getSnowId(oid);
    }

    @Override
    public void addLogsOid(String oid) {
        dao.addLogsOid(oid);
    }

    @Override
    public void addDetail(Detail detail) {
        dao.addDetail(detail);
    }

    @Override
    public Map detail(String oid) {
        return dao.detail(oid);
    }

    @Override
    public int addUpd(Logs logs) {
        return dao.addUpd(logs);
    }

    @Override
    public int del(String oid) {
        //(2)成功删除订单和订单明细并跳转列表页面并正确显示（2分）
        int i = dao.del(oid);
        if (i>0){
            dao.deldet(oid);
        }
        return i;
    }

    @Override
    public List hx(String oid) {
        return dao.hx(oid);
    }
}
